
const state = {
  // 缓存的组件
  catchComponents: []
}
const mutations = {
  SET_CATCHE_COMPONENTS (state, data) {
    // 防止重复
    const set = new Set(state.catchComponents)
    set.add(data)
    state.catchComponents = Array.from(set)
  },
  DEL_CATCHE_COMPONENTS (state, data) {
    state.catchComponents.forEach((element, index) => {
      if (data === element) {
        state.catchComponents.splice(index, 1)
      }
    })
  }
}
const actions = {
}
const getters = {}

export default {
  state,
  mutations,
  actions,
  getters
}
